﻿<div ng-controller="ListOpsController">
    <h1>List Operations</h1>

    <br />
    <select ng-model="Method">
        <option value="REST">REST</option>
        <option value="CSOM">CSOM</option>
    </select><br /><br />

    <b>List URL:</b><input type="text" ng-model="ListUrl" /> <br/>
    <b>List Name:</b><input type="text" ng-model="ListName" /><button type="button" ng-click="GetListItemsHost()">Get List from Host</button>

    <h2>Get List Items</h2>
    <input type="button" value="Get List Items" ng-click="GetListItems()" /><br />

    <ul>
        <li ng-repeat="item in Items"><input type="text" ng-model="item.Title" /><a href="javascript:void(0)" ng-click="UpdateItem(item)">Update</a><a href="javascript:void(0)" ng-click="DeleteItem(item)">Delete</a></li>
    </ul>

    <h2>Create Item</h2>
    <input type="text" ng-model="NewItemTitle" /><input type="button" value="Create Item" ng-click="CreateItem()" />
</div>
<script type="text/javascript" src="https://sharepointknight.sharepoint.com/_layouts/15/sp.requestexecutor.js"></script>